package work.jame.blog.pojo.dto;

import work.jame.blog.framework.VerificationGroup;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;

/**
 * 搜索包装类
 *
 * @author : Jame
 * @date : 2023-07-03 09:35
 **/
public class SearchDTO {
    /**
     * 搜索关键字
     */
    @NotEmpty(message = "搜索管关键字不能为空")
    private String keyword;

    /**
     * 搜索类型 1文章 2用户 3公告
     */
    @Min(value = 1, message = "搜索类型不在范围内")
    @Max(value = 3, message = "搜索类型不在范围内")
    private Integer type;


    private Long pageNumber;

    private Long pageSize;

    @Override
    public String toString() {
        return "SearchDTO{" +
                "keyword='" + keyword + '\'' +
                ", type=" + type +
                ", pageNumber=" + pageNumber +
                ", pageSize=" + pageSize +
                '}';
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(Long pageNumber) {
        this.pageNumber = pageNumber;
    }

    public Long getPageSize() {
        return pageSize;
    }

    public void setPageSize(Long pageSize) {
        this.pageSize = pageSize;
    }
}
